Optimal. Leaf size=676 \[ \frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \text {ArcTan}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {\left (b^2-4 (a-2 c) c\right ) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{8 c^{3/2} e}+\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}+\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 25.15, antiderivative size = 676, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 9, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3781, 1085,
1092, 635, 212, 1050, 1044, 214, 211} \begin {gather*} \frac {\sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \text {ArcTan}\left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-\left (-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} e \sqrt [4]{a^2-2 a c+b^2+c^2}}+\frac {\sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \tanh ^{-1}\left (\frac {\left (-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2\right ) \tan (d+e x)+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} e \sqrt [4]{a^2-2 a c+b^2+c^2}}-\frac {\left (b^2-4 c (a-2 c)\right ) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{8 c^{3/2} e}+\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 212
Rule 214
Rule 635
Rule 1044
Rule 1050
Rule 1085
Rule 1092
Rule 3781
Rubi steps
\begin {align*} \int \tan ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x^2 \sqrt {a+b x+c x^2}}{1+x^2} \, dx,x,\tan (d+e x)\right )}{e}\\ &=\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e}-\frac {\text {Subst}\left (\int \frac {\frac {1}{4} \left (b^2+4 a c\right )+2 b c x+\frac {1}{4} \left (b^2-4 (a-2 c) c\right ) x^2}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 c e}\\ &=\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e}-\frac {\text {Subst}\left (\int \frac {\frac {1}{4} \left (b^2+4 a c\right )+\frac {1}{4} \left (-b^2+4 (a-2 c) c\right )+2 b c x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 c e}-\frac {\left (b^2-4 (a-2 c) c\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{8 c e}\\ &=\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e}-\frac {\left (b^2-4 (a-2 c) c\right ) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{4 c e}+\frac {\text {Subst}\left (\int \frac {-2 c \left (a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )-2 b c \sqrt {a^2+b^2-2 a c+c^2} x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{4 c \sqrt {a^2+b^2-2 a c+c^2} e}-\frac {\text {Subst}\left (\int \frac {-2 c \left (a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+2 b c \sqrt {a^2+b^2-2 a c+c^2} x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{4 c \sqrt {a^2+b^2-2 a c+c^2} e}\\ &=-\frac {\left (b^2-4 (a-2 c) c\right ) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{8 c^{3/2} e}+\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e}-\frac {\left (2 b c \left (a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{8 b c^2 \sqrt {a^2+b^2-2 a c+c^2} \left (a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+b x^2} \, dx,x,\frac {-2 b c \sqrt {a^2+b^2-2 a c+c^2}+2 c \left (a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}-\frac {\left (2 b c \left (a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-8 b c^2 \sqrt {a^2+b^2-2 a c+c^2} \left (a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+b x^2} \, dx,x,\frac {2 b c \sqrt {a^2+b^2-2 a c+c^2}+2 c \left (a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}\\ &=\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \tan ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {\left (b^2-4 (a-2 c) c\right ) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{8 c^{3/2} e}+\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}+\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c e}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.51, size = 405, normalized size = 0.60 \begin {gather*} \frac {-\frac {\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{8 c^{3/2}}+\frac {1}{4} i \left (2 \sqrt {a-i b-c} \tanh ^{-1}\left (\frac {2 a-i b+(b-2 i c) \tan (d+e x)}{2 \sqrt {a-i b-c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )-\frac {(b-2 i c) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {c}}\right )-\frac {1}{4} i \left (2 \sqrt {a+i b-c} \tanh ^{-1}\left (\frac {2 a+i b+(b+2 i c) \tan (d+e x)}{2 \sqrt {a+i b-c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )-\frac {(b+2 i c) \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {c}}\right )+\frac {(b+2 c \tan (d+e x)) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{4 c}}{e} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] result has leaf size over 500,000. Avoiding possible recursion issues.
time = 0.43, size = 17248163, normalized size = 25515.03 \[\text {output too large to display}\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \tan {\left (d + e x \right )} + c \tan ^{2}{\left (d + e x \right )}} \tan ^{2}{\left (d + e x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\mathrm {tan}\left (d+e\,x\right )}^2\,\sqrt {c\,{\mathrm {tan}\left (d+e\,x\right )}^2+b\,\mathrm {tan}\left (d+e\,x\right )+a} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________